<%= form_tag(:controller => "entities", :action => "create_private_popsicle", :method => "post") do %> 
	<% unless @permissible_friends.empty? && @entity.privacy_level.private_messaging > 0 %>	
		<% if @entity.id == session[:user_id] %>
			<div class="hiddenfield">
				<%= hidden_field_tag(:private_author_id, @entity.id) %>
			</div>
			<div class="field">
				<%= label_tag(:recipient_id, "Select Recipient") %></br>
				<%= collection_select(nil,:recipient_id, @permissible_friends, :id, :name, {}, {:title=>'Choose recipient'}) %>
			</div>
		<% else %>
			<div class="hiddenfield">
				<%= hidden_field_tag(:private_author_id, session[:user_id]) %>
				<%= hidden_field_tag(:recipient_id, @entity.id) %>
			</div>
		<% end %>
		<div class="field">
			<%= label_tag(:subject, "Type subject") %></br>
			<%= text_field_tag(:subject,'', :rows => 1, :placeholder => 'Subject', :title => "Type the subject here" )%>
		</div>
		<div class="field">
			<%= label_tag(:content, "Type message") %></br>
			<%= text_area_tag(:content,'', :rows => 6, :placeholder => 'Enter your message here', :cols => 50, :title => "Type the message here" )%>
		</div>
		<div class="actions">
			<%= submit_tag "Send", :title => "Send the Message" %>
		</div>
	<% else %>
		<p>You must make friends before you can send private messages.</p>
	<% end %>
<% end %>
